<?php
	if (!isset($_GET['since']) || !isset($_GET['severity'])) exit;

	require_once('../classes/Config.class.php');
	require_once('../classes/Database.class.php');
	
	$Config = new Config();
	$DB = new Database();
	
	$since = $_GET['since'];
	$severity = $_GET['severity'];
	
	if (!get_magic_quotes_gpc()) {
		$since = addslashes($since);
		$severity = addslashes($severity);
	}
	
	$sql = $DB -> select('*', 'Events', "Timestamp >= $since AND Severity >= $severity", false, 'Timestamp', 'ASC');
	
	while ($row = $DB -> row($sql)) {
		$time = $row['Timestamp'];
		echo "$row[ID],$row[Severity],$row[Symbol],$time,", date('H', $time), ",", date('i', $time), "\n";
	}
?>